package com.ylw.javaStudy.security.provider;

import org.junit.Test;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;

/**
 *
 */
public class ProviderTest {

    /**
     * 获取一个provider
     *
     */
    @Test
    public void test01() {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA-256");
            System.out.println(md);
            md = MessageDigest.getInstance("SHA-256", "SUN");
            System.out.println(md);
        }
        catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        catch (NoSuchProviderException e) {
            e.printStackTrace();
        }
    }
}
